Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ledger] Fix ledger rollover scheduled task #11116

Merged
merged 3 commits into from Jul 2, 2021

Conversation

gaoran10
Copy link
Contributor

Motivation

Currently, the ledger rollover scheduled task will execute before reach the ledger maximum rollover time, this will cause the ledger doesn't roll over in time.

Modifications

Only make the ledger rollover scheduled task after the ledger created successfully.
If the scheduled task was executed when there is no entry in the current ledger, the scheduled task will not be re-executed, and if there is new entry is added the ledger will rollover.

Verifying this change

Add a unit test to verify the ledger could be rolled over in time.

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API: (no)
  • The schema: (no)
  • The default values of configurations: (no)
  • The wire protocol: (no)
  • The rest endpoints: (no)
  • The admin cli options: (no)
  • Anything that affects deployment: (no)

@Anonymitaet
Copy link
Member

@gaoran10 does this affect docs?

@Anonymitaet
Copy link
Member

Hi @gaoran10 any feedback?

@gaoran10
Copy link
Contributor Author

@gaoran10 does this affect docs?

Sorry late response, this is not affect doc.

@gaoran10 gaoran10 force-pushed the fix-ledger-rollover-scheduler-task branch from 8d42418 to eadebdc Compare June 29, 2021 11:04
@Anonymitaet Anonymitaet added the doc-not-needed Your PR changes do not impact docs label Jun 30, 2021
Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@eolivelli eolivelli added this to the 2.9.0 milestone Jun 30, 2021
@sijie sijie merged commit a092ceb into apache:master Jul 2, 2021
@gaoran10 gaoran10 deleted the fix-ledger-rollover-scheduler-task branch July 7, 2021 02:40
codelipenghui pushed a commit that referenced this pull request Jul 7, 2021
### Motivation

Currently, the ledger rollover scheduled task will execute before reach the ledger maximum rollover time, this will cause the ledger doesn't roll over in time.

### Modifications

Only make the ledger rollover scheduled task after the ledger created successfully.
If the scheduled task was executed when there is no entry in the current ledger, the scheduled task will not be re-executed, and if there is new entry is added the ledger will rollover.

### Verifying this change

Add a unit test to verify the ledger could be rolled over in time.

(cherry picked from commit a092ceb)
@codelipenghui codelipenghui added the cherry-picked/branch-2.8 Archived: 2.8 is end of life label Jul 7, 2021
codelipenghui pushed a commit that referenced this pull request Jul 9, 2021
The PR #11116 couldn't be cherry-picked to `branch-2.7`, because there are too many conflicts.

In PR #8946 the ledger rollover task had been moved from `BrokerService` to `ManagedLedgerImpl`, and this PR is based on it.

### Motivation

Currently, the ledger rollover scheduled task will execute before reach the ledger maximum rollover time, this will cause the ledger doesn't roll over in time.

### Modifications

Only make the ledger rollover scheduled task after the ledger created successfully.
If the scheduled task was executed when there is no entry in the current ledger, the scheduled task will not be re-executed, and if there is new entry is added the ledger will rollover.
@codelipenghui codelipenghui added the cherry-picked/branch-2.7 Archived: 2.7 is end of life label Jul 12, 2021
bharanic-dev pushed a commit to bharanic-dev/pulsar that referenced this pull request Mar 18, 2022
### Motivation

Currently, the ledger rollover scheduled task will execute before reach the ledger maximum rollover time, this will cause the ledger doesn't roll over in time.

### Modifications

Only make the ledger rollover scheduled task after the ledger created successfully.
If the scheduled task was executed when there is no entry in the current ledger, the scheduled task will not be re-executed, and if there is new entry is added the ledger will rollover.

### Verifying this change

Add a unit test to verify the ledger could be rolled over in time.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/broker cherry-picked/branch-2.7 Archived: 2.7 is end of life cherry-picked/branch-2.8 Archived: 2.8 is end of life doc-not-needed Your PR changes do not impact docs release/2.7.3 release/2.8.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants